package poo.esempi;

public class EsempioVarArg {

	public static void main(String[] args) {
		String t = "awgrbawrg";
		
		int m1 = max(10, 20, 12);
		int m2 = max(-2, 3, 4354, 324, 64);
		System.out.println("Max1= " + m1 + ";\n" + "Max2= " + m2 + ";");

	}

	private static int max(int... v) {
		
		int m = v[0];
		for (int i = 0; i < v.length; i++)
			if (v[i] > m)
				m = v[i];
		return m;
	}

}
